# coding:utf-8
# @Time : 2021/5/6 19:51 
# @Author : minuy
# @File : web.py
from flask import jsonify, url_for

from app.api import api


@api.route('/init.json')
def web_init():
    init = {
        "homeInfo": {
            "title": "首页",
            "href": "page/welcome-1.html?t=1"
        },
        "logoInfo": {
            "title": "第五玩伴",
            "image": url_for('static', filename='images/logo.png'),
            "href": ""
        },
        "menuInfo": [
            {
                "title": "系统管理",
                "icon": "fa fa-address-book",
                "href": "",
                "target": "_self",
                "child": [
                    {
                        "title": "系统状态",
                        "href": "page/table.html",
                        "icon": "fa fa-file-text",
                        "target": "_self"
                    },
                    {
                        "title": "页面展示",
                        "href": "",
                        "icon": "fa fa-home",
                        "target": "_self",
                        "child": [
                            {
                                "title": "404页面",
                                "href": "page/404.html",
                                "icon": "fa fa-hourglass-end",
                                "target": "_self"
                            },
                            {
                                "title": "错误页面",
                                "href": "page/404.html",
                                "icon": "fa fa-hourglass-end",
                                "target": "_self"
                            }
                        ]
                    }
                ]
            },
            {
                "title": "用户管理",
                "icon": "fa fa-lemon-o",
                "href": "",
                "target": "_self",
                "child": [
                    {
                        "title": "用户查询",
                        "href": "page/table-select.html",
                        "icon": "fa fa-search",
                        "target": "_self"
                    },
                    {
                        "title": "用户修改",
                        "href": "page/table-select.html",
                        "icon": "fa fa-angle-double-down",
                        "target": "_self"
                    },
                    {
                        "title": "添加用户",
                        "href": "page/icon.html",
                        "icon": "fa fa-dot-circle-o",
                        "target": "_self"
                    },
                    {
                        "title": "冻结用户",
                        "href": "page/icon-picker.html",
                        "icon": "fa fa-adn",
                        "target": "_self"
                    },
                    {
                        "title": "解冻用户",
                        "href": "page/color-select.html",
                        "icon": "fa fa-dashboard",
                        "target": "_self"
                    }
                ]
            },
            {
                "title": "发布管理",
                "icon": "fa fa-slideshare",
                "href": "",
                "target": "_self",
                "child": [
                    {
                        "title": "发布查询",
                        "href": "",
                        "icon": "fa fa-search",
                        "target": ""
                    },
                    {
                        "title": "发布修改",
                        "href": "",
                        "icon": "fa fa-meetup",
                        "target": ""
                    },
                    {
                        "title": "发布删除",
                        "href": "page/error.html",
                        "icon": "fa fa-superpowers",
                        "target": "_self"
                    }
                ]
            },
            {
                "title": "订单管理",
                "icon": "fa fa-slideshare",
                "href": "",
                "target": "_self",
                "child": [
                    {
                        "title": "订单查询",
                        "href": "",
                        "icon": "fa fa-search",
                        "target": ""
                    },
                    {
                        "title": "订单修改",
                        "href": "",
                        "icon": "fa fa-meetup",
                        "target": ""
                    },
                    {
                        "title": "订单删除",
                        "href": "page/error.html",
                        "icon": "fa fa-superpowers",
                        "target": "_self"
                    }
                ]
            },
            {
                "title": "动态管理",
                "icon": "fa fa-slideshare",
                "href": "",
                "target": "_self",
                "child": [
                    {
                        "title": "动态查询",
                        "href": "",
                        "icon": "fa fa-search",
                        "target": ""
                    },
                    {
                        "title": "动态修改",
                        "href": "page/error.html",
                        "icon": "fa fa-superpowers",
                        "target": "_self"
                    },
                    {
                        "title": "动态删除",
                        "href": "page/error.html",
                        "icon": "fa fa-superpowers",
                        "target": "_self"
                    }
                ]
            }
        ]
    }
    return jsonify(init)
